﻿using System;
using System.Diagnostics;
namespace Program12_Process
{
    class Program
    {
        static void Main(string[] args)
        {
            ////获取当前程序中所有正在运行的进程
            //Process[] pros = Process.GetProcesses();
            //foreach (var p in pros)
            //{
            //    Console.WriteLine(p);
            //    //不试不是爷们！！！！
            //    //p.Kill();
            //}

            ////通过应用程序打开一应用的进程
            //Console.ReadKey();
            //Process.Start("calc");
            //Process.Start("mspaint");
            //Process.Start("notepad");
            //Process.Start("chrome", "https://baidu.com");

            //通过进程打开指定的exe
            Console.ReadKey();

            ProcessStartInfo psi = new ProcessStartInfo(@"C:\Program Files (x86)\Tencent\QQMusic\QQMusic.exe");

            //创建进程
            Process p = new Process();
            p.StartInfo = psi;
            p.Start();

            ProcessStartInfo psi1 = new ProcessStartInfo(@"D:\WeChat\WeChat.exe");
            Process p1 = new Process();
            p1.StartInfo = psi1;
            p1.Start();
        }
    }
}
